package
{
	import com.designCreator.skins.CatButtonSkin;
	
	import flash.events.MouseEvent;
	import flash.external.ExternalInterface;
	
	import mx.controls.Alert;
	import mx.events.CloseEvent;
	
	import spark.components.Button;
	
	public class CatButton extends Button
	{
		public function CatButton()
		{
			super();
			buttonMode = true;
			setStyle('skinClass',CatButtonSkin);
		}
		
		private var firstAlert:Alert;
		
		
		override protected function clickHandler(event:MouseEvent):void
		{
			Alert.show('Are you sure you want to leave, \n your selection will not be saved',	'Company Name',Alert.YES | Alert.NO, null, closeHandler, null, Alert.YES);
		}
		
		protected function closeHandler(evt:CloseEvent):void
		{
			if(evt.detail == Alert.YES)
			{
				ExternalInterface.call('window.location.reload()');
			}
		}
			
	}
}